package com.lijian.client.feign;

import com.lijian.pojo.Menu;
import com.lijian.pojo.MenuResult;
import com.lijian.pojo.Type;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient(value = "menu-service")
public interface MenuFeign {
    @GetMapping("/menu")
    public MenuResult findAll(@RequestParam Integer page, @RequestParam Integer limit);

    @DeleteMapping("/menu/deleteById/{id}")
    public void deleteMenuById(@PathVariable Integer id);

    @GetMapping("/menu/findTypes")
    public List<Type> findTypes();

    @GetMapping("/menu/findType/{id}")
    public Type findTypeById(@PathVariable Integer id);

    @PostMapping("/menu/save")
    public void saveMenu(@RequestBody Menu menu);

    @GetMapping("/menu/findById/{id}")
    public Menu findById(@PathVariable Integer id);

    @PutMapping("/menu/update")
    public void update(@RequestBody Menu menu);
}
